package com.demo.modules.image.controller;

import com.demo.common.result.Result;
import com.demo.modules.image.domain.dto.ImageContentUrlDto;
import com.demo.modules.image.service.ImageContentService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 图片内容解析
 *
 * @author admin
 */
@RestController
@RequestMapping("image/content/parse")
public class ImageContentParseController {
    @Resource
    private ImageContentService imageContentService;

    /**
     * 图片解析
     *
     * @param imageContentUrlDto 图片地址信息
     * @return Result<String>
     */
    @PostMapping("parseForUrl")
    public Result<String> parseForUrl(@RequestBody ImageContentUrlDto imageContentUrlDto) {
        return Result.success(imageContentService.parseForUrl(imageContentUrlDto));
    }
}
